//
//  LimitBuyResult.swift
//  StoryDemo
//
//  Created by mac on 2019/7/8.
//  Copyright © 2019年 zhkj. All rights reserved.
//

import Foundation
import SwiftyJSON

struct LimitBuyResult {
    var Total: Int = 0
    var List = [Lists]()
    
    init(json: JSON) {
        Total = json["Total"].intValue
        List = json["List"].arrayValue.compactMap({ Lists(json: $0)})
    }
}

struct mLimitCashDepositsServer {
    var IsTimelyShip: Bool = false
    var IsSevenDayNoReasonReturn: Bool = false
    var CanSelfTake: Bool = false
    var IsCustomerSecurity: Bool = false
    
    init(json: JSON) {
        IsTimelyShip = json["IsTimelyShip"].boolValue
        IsSevenDayNoReasonReturn = json["IsSevenDayNoReasonReturn"].boolValue
        CanSelfTake = json["CanSelfTake"].boolValue
        IsCustomerSecurity = json["IsCustomerSecurity"].boolValue
    }
}

struct Lists {
    var MinPrice: Int = 0
    var ProductName: String?
    var Id: Int = 0
    var CashDepositsServer: mLimitCashDepositsServer?
    var MarketPrice: Int = 0
    var Address: String?
    var Stock: Int = 0
    var ProductAttributeInfos = [String]()
    var EndDate: String?
    var SaleCount: Int = 0
    var ShopName: String?
    var ProductId: Int = 0
    var ProductImg: String?
    
    init(json: JSON) {
        MinPrice = json["MinPrice"].intValue
        ProductName = json["ProductName"].stringValue
        Id = json["Id"].intValue
        CashDepositsServer = mLimitCashDepositsServer(json: json["CashDepositsServer"])
        MarketPrice = json["MarketPrice"].intValue
        Address = json["Address"].stringValue
        Stock = json["Stock"].intValue
        ProductAttributeInfos = json["ProductAttributeInfos"].arrayValue.compactMap({$0.stringValue})
        EndDate = json["EndDate"].stringValue
        SaleCount = json["SaleCount"].intValue
        ShopName = json["ShopName"].stringValue
        ProductId = json["ProductId"].intValue
        ProductImg = json["ProductImg"].stringValue
    }
}

